﻿
Partial Class API_Folder
    Inherits MyUI.PageBaseApp



    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load

        'Dim o = New With {.aa = 123, .bbb = "ww"}

        Response.ContentType = "application/json"


        Dim t = Me.GetType

        Dim f = t.GetMethod(Me.Request.Url.Segments.Last, Reflection.BindingFlags.Instance + Reflection.BindingFlags.Public + Reflection.BindingFlags.IgnoreCase)

        Dim p = f.GetParameters.ToDictionary(Function(o) o.Name)
        Dim pram(p.Count - 1) As Object

        For Each q In Request.QueryString.Keys

            If p.ContainsKey(q) Then
                pram(p(q).Position) = Request.QueryString(q)
            End If

        Next


        Dim oo = f.Invoke(Me, pram)

        Response.Write(MyApp.JSONSerialize(oo))


    End Sub

    Public Function [get](id As String) As Object

        Dim o = New With {.aa = id, .bbb = "ww"}


        Return o

    End Function

    Public Function bbbb(ttt As String) As Object

        Dim o = New With {.aa = 999, .bbb = ttt}


        Return o

    End Function

End Class
